#include<string.h>
#include<stdio.h>
int main()
{
    //strlen:计算字符串长度不计算\0
    //strcmp:字符串比较 返回值为int>0 前比后大 =0 相等 <0 前小
    //strnccmp:比较n个字符
    //strcpy:字符拷贝 不安全
    //strncpy:拷贝n个字符
    //strcat:字符串拼接
    //strncat;
    //strstr:字符串查找;
    //strtok:字符串切割  ,会修改原字符串
    char s1[]="helloworld";
    char s2[]="hello";
    printf("%ld\n",strlen(s1));
    printf("%ld\n",sizeof(s2));
    printf("%d\n",strcmp(s1,s2));
    printf("%d\n",strncmp(s1,s2,5));
    char s3[11]="world";
    char s4[3];
    strncpy(s4,s3,sizeof(s4)-1);
    strncat(s2,s3,sizeof(s2)-1-strlen(s2));
    char *dest=strstr(s1,s2);
    if(dest==NULL)
    printf("未匹配子串");
    else
    printf("找到子串");
    char s5[]="jeky,,cedy,coke";
    //返回切割下来的第一段字符串
    dest=strtok(s5,",");
    printf("%s\n",dest);
    //切割剩下的字符串，传入null
    dest=strtok(NULL,",");
    printf("%s\n",dest);
    
    dest=strtok(NULL,",");
    printf("%s\n",dest);
    //无法切割返回null

    return 0;
}